﻿<%@ Control Language="C#"  AutoEventWireup="true" CodeFile="ControlThongTinKhachHang.ascx.cs" Inherits="WebUserControl_ControlThongTinKhachHang" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc2" %>
<script type="text/javascript"  src='<%=ResolveUrl("~/JScript/jquery.alphanumeric.js")%>'></script>
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/datePicker.css")%>' type="text/css" />
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />

<script type="text/javascript">
     function pageLoad() {
     
     $("#<%= txtDiDong.ClientID %>").numeric();
     $("#<%= txtDTNha.ClientID %>").numeric();
     $("#<%= txtSoCMND.ClientID %>").numeric();
     
      $(function()
     {
	    $("#<%= txtNgaySinh.ClientID %>").datePicker(
		{
			clickInput:true,
			startDate: '01/01/1970'
		}
	);
});

      $("#<%= imgTaoMoi.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
        $("#<%= imgSave.ClientID %>").click(function() {
            if ($("#<%= txtTenKhachHang.ClientID %>").val().length > 0 && $("#<%= txtSoCMND.ClientID %>").val().length > 0 && $("#<%= txtNgaySinh.ClientID %>").val().length > 0)
        {
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }
        }); 
       
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
        }  
   
</script> 
<style type="text/css">
   
        .AutoExtender
        {
            font-family: Verdana, Helvetica, sans-serif;
            font-size: .8em;
            font-weight: normal;
            border: solid 1px #006699;
            line-height: 20px;
            padding: 10px;
            background-color: White;
            margin-left:10px;
        }
        .AutoExtenderList
        {
            border-bottom: dotted 1px #006699;
            cursor: pointer;
            color: Maroon;
        }
        .AutoExtenderHighlight
        {
            color: White;
            background-color: #006699;
            cursor: pointer;
        }
        #divwidth
        {
          width: auto !important;    
        }
        #divwidth div
       {
        width: auto !important;   
       }
 </style>


<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <fieldset>
            <legend>Thông tin khách hàng</legend>
        </fieldset>
        
        <asp:Panel ID="Panel1" runat="server" BackColor="#EBEBEB" BorderStyle="None" 
            Height="33px" Width="100%">
            <asp:ImageButton ID="imgTaoMoi" ToolTip="Thêm mới khách hàng" runat="server" Width="25px" Height="25px" 
                ImageUrl="~/image/New File.png" onclick="imgTaoMoi_Click" 
                CausesValidation="False" />
            &nbsp;&nbsp;<asp:ImageButton ToolTip="Lưu thông tin" ID="imgSave" Width="25px" runat="server" Height="25px" 
                ImageUrl="~/image/Save.png" onclick="imgSave_Click" />
            &nbsp;&nbsp;<asp:ImageButton ToolTip="Tìm kiếm thông tin" ID="imgTim" runat="server" Height="25px" 
                ImageUrl="~/image/Find.png" Width="25px" onclick="imgTim_Click" 
                CausesValidation="False" />
            &nbsp;&nbsp;<asp:ImageButton ToolTip="Mua hàng" ID="ImageMuaHang" 
                runat="server" Height="25px" 
                ImageUrl="~/image/forw.png" Width="25px" 
                CausesValidation="False" onclick="ImageMuaHang_Click" />
        </asp:Panel>
        <br />
        <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            Width="868px" Height="600px">
            <cc1:TabPanel TabIndex="0" ID="TabPanel1" runat="server" HeaderText="Nhập thông tin">
            <ContentTemplate>
             <fieldset>
                    <legend>Thông tin khách hàng</legend>
                        <div class="fm-req">
                        <label for="txtMaTuVanVien">Mã khách hàng:</label>
                         <asp:TextBox ID="txtMaKH" BackColor="Yellow" runat="server" ReadOnly="True" Width="150px"></asp:TextBox>
                        </div>
                        <div class="fm-req">
                        <label for="txtMaTuVanVien">Họ tên khách hàng:</label>
                         <asp:TextBox ID="txtTenKhachHang" runat="server" Width="200px"></asp:TextBox>
                         <asp:RequiredFieldValidator ControlToValidate="txtTenKhachHang" ID="R1" Display="None" runat="server" ErrorMessage="Nhập tên khách hàng"></asp:RequiredFieldValidator>
                         <cc1:ValidatorCalloutExtender TargetControlID="R1" 
                                ID="ValidatorCalloutExtender1" runat="server" Enabled="True">
                          </cc1:ValidatorCalloutExtender>
                        </div>
                         <div class="fm-req">
                          <label for="txtMaTuVanVien">Số CMND:</label>
                            <asp:TextBox ID="txtSoCMND" runat="server" Width="200px"></asp:TextBox>
                            <asp:RequiredFieldValidator ControlToValidate="txtSoCMND" ID="R2" Display="None" runat="server" ErrorMessage="Nhập số chứng minh nhân dân"></asp:RequiredFieldValidator>
                             <cc1:ValidatorCalloutExtender TargetControlID="R2" 
                                ID="ValidatorCalloutExtender2" runat="server" Enabled="True">
                             </cc1:ValidatorCalloutExtender>
                         </div>
                         <div class="fm-req">
                          <label for="txtMaTuVanVien">Ngày sinh:</label>
                           <asp:TextBox ID="txtNgaySinh" runat="server" Width="150px"></asp:TextBox>
                           <asp:RequiredFieldValidator ControlToValidate="txtNgaySinh" ID="RequiredFieldValidator1" Display="None" runat="server" ErrorMessage="Nhập ngày sinh"></asp:RequiredFieldValidator>
                             <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator1" 
                                ID="ValidatorCalloutExtender3" runat="server" Enabled="True">
                             </cc1:ValidatorCalloutExtender>
                          </div>
                           <div class="fm-req">
                        <label for="txtMaTuVanVien">Giới tính nam:</label>
                         <asp:CheckBox ID="CheckGioiTinh" runat="server" />
                        </div>
                         <div class="fm-req">
                        <label for="txtMaTuVanVien">Độc thân:</label>
                          <asp:CheckBox ID="CheckHonNhan" runat="server" />
                        </div>
                        <div class="fm-req">
                          <label for="txtMaTuVanVien">Địa chỉ:</label>
                           <asp:TextBox ID="txtDiaChi" runat="server" Width="200px"></asp:TextBox>
                         </div>
                         <div class="fm-req">
                        <label for="txtMaTuVanVien">Tỉnh/Thành:</label>
                         <asp:DropDownList ID="DropTinh" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropTinh_SelectedIndexChanged1" 
                                    TabIndex="13" Width="130px">
                                </asp:DropDownList>
                        </div>
                          <div class="fm-req">
                      <label for="DropTinh">Quận/Huyện:</label> 
                    <asp:DropDownList ID="DropQuanHuyen" runat="server" TabIndex="14" Width="130px">
                                </asp:DropDownList>
                     </div>
                        
                        
                         <div class="fm-re">
                          <label for="txtMaTuVanVien">ĐT Di động:</label>
                          <asp:TextBox ID="txtDiDong" runat="server" Width="150px"></asp:TextBox>
                         </div>
                         <div class="fm-re">
                          <label for="txtMaTuVanVien">ĐT nhà:</label>
                          <asp:TextBox ID="txtDTNha" runat="server" Width="150px"></asp:TextBox>
                         </div>
                       
                         
                          <div class="fm-re">
                          <label for="txtMaTuVanVien">Nghề nghiệp:</label>
                            <asp:TextBox ID="txtNgheNghiep" runat="server" Width="200px"></asp:TextBox>
                         </div>
                          <div class="fm-re">
                          <label for="txtMaTuVanVien">Loại da:</label>
                            <asp:TextBox ID="txtSkin" runat="server" Width="150px"></asp:TextBox>
                         </div>
                          <div class="fm-re">
                          <label for="txtMaTuVanVien">Loại da trước khi sử dụng:</label>
                            <asp:TextBox ID="txtBeforeSkin" runat="server" Width="150px"></asp:TextBox>
                         </div>
                         
		                 <div class="fm-re">
                          <label for="txtMaTuVanVien">Thẻ VIP:</label>
                           <asp:TextBox ID="txtVip" runat="server" Width="150px"></asp:TextBox>
                          </div>
		
	</fieldset>

            </ContentTemplate>
            </cc1:TabPanel>
            <cc1:TabPanel ID="TabPanel2" TabIndex="1" runat="server" HeaderText="Tìm kiếm">
            <ContentTemplate>
            <fieldset>
		 <div class="fm-req">
                       <label for="TxtMaNganhHang">Nhập thông tin cần tìm:</label> 
            <asp:TextBox ID="TextBox1" runat="server" Width="150px" AutoPostBack="True"  ontextchanged="TextBox1_TextChanged"></asp:TextBox>
            <asp:ImageButton ID="ImageButton1" runat="server" style="width: 16px"  ImageUrl="~/image/Search.png" onclick="ImageButton1_Click" CausesValidation="False" />
        </fieldset>
        <br />
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" onpageindexchanging="GridView1_PageIndexChanging" 
                onrowcommand="GridView1_RowCommand" PageSize="5" Width="500px" CellPadding="4" 
                    EnableModelValidation="True" ForeColor="#333333" GridLines="None">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:BoundField HeaderText="Mã khách hàng"  DataField="CustomerKey"/>
                    <asp:BoundField HeaderText="Tên khách hàng" DataField="CustomerName" />
                    <asp:BoundField HeaderText="Địa chỉ"  DataField="Address"/>
                    <asp:BoundField HeaderText="Số điện thoại" DataField="Phone" />

                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="false" CommandName="chon" 
                                Height="20px" Width="20px" ImageUrl="~/image/Symbol-Check.png" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            </asp:GridView>
      
            </ContentTemplate>
            </cc1:TabPanel>
        </cc1:TabContainer>
       
      
    </ContentTemplate>
</asp:UpdatePanel>
 <uc2:uscMsgBox ID="uscMsgBox1" runat="server" />


